home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Portable Patmos / usr / include / rpcsvc / nfs_prot.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-08  |  5.8 KB  |  344 lines  |  [TEXT/R*ch]

  1. #define NFS_PORT 2049
  2. #define NFS_MAXDATA 8192
  3. #define NFS_MAXPATHLEN 1024
  4. #define NFS_MAXNAMLEN 255
  5. #define NFS_FHSIZE 32
  6. #define NFS_COOKIESIZE 4
  7. #define NFS_FIFO_DEV -1
  8. #define NFSMODE_FMT 0170000
  9. #define NFSMODE_DIR 0040000
  10. #define NFSMODE_CHR 0020000
  11. #define NFSMODE_BLK 0060000
  12. #define NFSMODE_REG 0100000
  13. #define NFSMODE_LNK 0120000
  14. #define NFSMODE_SOCK 0140000
  15. #define NFSMODE_FIFO 0010000
  16.  
  17. enum nfsstat {
  18.     NFS_OK = 0,
  19.     NFSERR_PERM = 1,
  20.     NFSERR_NOENT = 2,
  21.     NFSERR_IO = 5,
  22.     NFSERR_NXIO = 6,
  23.     NFSERR_ACCES = 13,
  24.     NFSERR_EXIST = 17,
  25.     NFSERR_NODEV = 19,
  26.     NFSERR_NOTDIR = 20,
  27.     NFSERR_ISDIR = 21,
  28.     NFSERR_FBIG = 27,
  29.     NFSERR_NOSPC = 28,
  30.     NFSERR_ROFS = 30,
  31.     NFSERR_NAMETOOLONG = 63,
  32.     NFSERR_NOTEMPTY = 66,
  33.     NFSERR_DQUOT = 69,
  34.     NFSERR_STALE = 70,
  35.     NFSERR_WFLUSH = 99,
  36. };
  37. typedef enum nfsstat nfsstat;
  38. bool_t xdr_nfsstat();
  39.  
  40.  
  41. enum ftype {
  42.     NFNON = 0,
  43.     NFREG = 1,
  44.     NFDIR = 2,
  45.     NFBLK = 3,
  46.     NFCHR = 4,
  47.     NFLNK = 5,
  48.     NFSOCK = 6,
  49.     NFBAD = 7,
  50.     NFFIFO = 8,
  51. };
  52. typedef enum ftype ftype;
  53. bool_t xdr_ftype();
  54.  
  55.  
  56. struct nfs_fh {
  57.     char data[NFS_FHSIZE];
  58. };
  59. typedef struct nfs_fh nfs_fh;
  60. bool_t xdr_nfs_fh();
  61.  
  62.  
  63. struct nfstime {
  64.     u_int seconds;
  65.     u_int useconds;
  66. };
  67. typedef struct nfstime nfstime;
  68. bool_t xdr_nfstime();
  69.  
  70.  
  71. struct fattr {
  72.     ftype type;
  73.     u_int mode;
  74.     u_int nlink;
  75.     u_int uid;
  76.     u_int gid;
  77.     u_int size;
  78.     u_int blocksize;
  79.     u_int rdev;
  80.     u_int blocks;
  81.     u_int fsid;
  82.     u_int fileid;
  83.     nfstime atime;
  84.     nfstime mtime;
  85.     nfstime ctime;
  86. };
  87. typedef struct fattr fattr;
  88. bool_t xdr_fattr();
  89.  
  90.  
  91. struct sattr {
  92.     u_int mode;
  93.     u_int uid;
  94.     u_int gid;
  95.     u_int size;
  96.     nfstime atime;
  97.     nfstime mtime;
  98. };
  99. typedef struct sattr sattr;
  100. bool_t xdr_sattr();
  101.  
  102.  
  103. typedef char *filename;
  104. bool_t xdr_filename();
  105.  
  106.  
  107. typedef char *nfspath;
  108. bool_t xdr_nfspath();
  109.  
  110.  
  111. struct attrstat {
  112.     nfsstat status;
  113.     union {
  114.         fattr attributes;
  115.     } attrstat_u;
  116. };
  117. typedef struct attrstat attrstat;
  118. bool_t xdr_attrstat();
  119.  
  120.  
  121. struct sattrargs {
  122.     nfs_fh file;
  123.     sattr attributes;
  124. };
  125. typedef struct sattrargs sattrargs;
  126. bool_t xdr_sattrargs();
  127.  
  128.  
  129. struct diropargs {
  130.     nfs_fh dir;
  131.     filename name;
  132. };
  133. typedef struct diropargs diropargs;
  134. bool_t xdr_diropargs();
  135.  
  136.  
  137. struct diropokres {
  138.     nfs_fh file;
  139.     fattr attributes;
  140. };
  141. typedef struct diropokres diropokres;
  142. bool_t xdr_diropokres();
  143.  
  144.  
  145. struct diropres {
  146.     nfsstat status;
  147.     union {
  148.         diropokres diropres;
  149.     } diropres_u;
  150. };
  151. typedef struct diropres diropres;
  152. bool_t xdr_diropres();
  153.  
  154.  
  155. struct readlinkres {
  156.     nfsstat status;
  157.     union {
  158.         nfspath data;
  159.     } readlinkres_u;
  160. };
  161. typedef struct readlinkres readlinkres;
  162. bool_t xdr_readlinkres();
  163.  
  164.  
  165. struct readargs {
  166.     nfs_fh file;
  167.     u_int offset;
  168.     u_int count;
  169.     u_int totalcount;
  170. };
  171. typedef struct readargs readargs;
  172. bool_t xdr_readargs();
  173.  
  174.  
  175. struct readokres {
  176.     fattr attributes;
  177.     struct {
  178.         u_int data_len;
  179.         char *data_val;
  180.     } data;
  181. };
  182. typedef struct readokres readokres;
  183. bool_t xdr_readokres();
  184.  
  185.  
  186. struct readres {
  187.     nfsstat status;
  188.     union {
  189.         readokres reply;
  190.     } readres_u;
  191. };
  192. typedef struct readres readres;
  193. bool_t xdr_readres();
  194.  
  195.  
  196. struct writeargs {
  197.     nfs_fh file;
  198.     u_int beginoffset;
  199.     u_int offset;
  200.     u_int totalcount;
  201.     struct {
  202.         u_int data_len;
  203.         char *data_val;
  204.     } data;
  205. };
  206. typedef struct writeargs writeargs;
  207. bool_t xdr_writeargs();
  208.  
  209.  
  210. struct createargs {
  211.     diropargs where;
  212.     sattr attributes;
  213. };
  214. typedef struct createargs createargs;
  215. bool_t xdr_createargs();
  216.  
  217.  
  218. struct renameargs {
  219.     diropargs from;
  220.     diropargs to;
  221. };
  222. typedef struct renameargs renameargs;
  223. bool_t xdr_renameargs();
  224.  
  225.  
  226. struct linkargs {
  227.     nfs_fh from;
  228.     diropargs to;
  229. };
  230. typedef struct linkargs linkargs;
  231. bool_t xdr_linkargs();
  232.  
  233.  
  234. struct symlinkargs {
  235.     diropargs from;
  236.     nfspath to;
  237.     sattr attributes;
  238. };
  239. typedef struct symlinkargs symlinkargs;
  240. bool_t xdr_symlinkargs();
  241.  
  242.  
  243. typedef char nfscookie[NFS_COOKIESIZE];
  244. bool_t xdr_nfscookie();
  245.  
  246.  
  247. struct readdirargs {
  248.     nfs_fh dir;
  249.     nfscookie cookie;
  250.     u_int count;
  251. };
  252. typedef struct readdirargs readdirargs;
  253. bool_t xdr_readdirargs();
  254.  
  255.  
  256. struct entry {
  257.     u_int fileid;
  258.     filename name;
  259.     nfscookie cookie;
  260.     struct entry *nextentry;
  261. };
  262. typedef struct entry entry;
  263. bool_t xdr_entry();
  264.  
  265.  
  266. struct dirlist {
  267.     entry *entries;
  268.     bool_t eof;
  269. };
  270. typedef struct dirlist dirlist;
  271. bool_t xdr_dirlist();
  272.  
  273.  
  274. struct readdirres {
  275.     nfsstat status;
  276.     union {
  277.         dirlist reply;
  278.     } readdirres_u;
  279. };
  280. typedef struct readdirres readdirres;
  281. bool_t xdr_readdirres();
  282.  
  283.  
  284. struct statfsokres {
  285.     u_int tsize;
  286.     u_int bsize;
  287.     u_int blocks;
  288.     u_int bfree;
  289.     u_int bavail;
  290. };
  291. typedef struct statfsokres statfsokres;
  292. bool_t xdr_statfsokres();
  293.  
  294.  
  295. struct statfsres {
  296.     nfsstat status;
  297.     union {
  298.         statfsokres reply;
  299.     } statfsres_u;
  300. };
  301. typedef struct statfsres statfsres;
  302. bool_t xdr_statfsres();
  303.  
  304.  
  305. #define NFS_PROGRAM ((u_long)100003)
  306. #define NFS_VERSION ((u_long)2)
  307. #define NFSPROC_NULL ((u_long)0)
  308. extern void *nfsproc_null_2();
  309. #define NFSPROC_GETATTR ((u_long)1)
  310. extern attrstat *nfsproc_getattr_2();
  311. #define NFSPROC_SETATTR ((u_long)2)
  312. extern attrstat *nfsproc_setattr_2();
  313. #define NFSPROC_ROOT ((u_long)3)
  314. extern void *nfsproc_root_2();
  315. #define NFSPROC_LOOKUP ((u_long)4)
  316. extern diropres *nfsproc_lookup_2();
  317. #define NFSPROC_READLINK ((u_long)5)
  318. extern readlinkres *nfsproc_readlink_2();
  319. #define NFSPROC_READ ((u_long)6)
  320. extern readres *nfsproc_read_2();
  321. #define NFSPROC_WRITECACHE ((u_long)7)
  322. extern void *nfsproc_writecache_2();
  323. #define NFSPROC_WRITE ((u_long)8)
  324. extern attrstat *nfsproc_write_2();
  325. #define NFSPROC_CREATE ((u_long)9)
  326. extern diropres *nfsproc_create_2();
  327. #define NFSPROC_REMOVE ((u_long)10)
  328. extern nfsstat *nfsproc_remove_2();
  329. #define NFSPROC_RENAME ((u_long)11)
  330. extern nfsstat *nfsproc_rename_2();
  331. #define NFSPROC_LINK ((u_long)12)
  332. extern nfsstat *nfsproc_link_2();
  333. #define NFSPROC_SYMLINK ((u_long)13)
  334. extern nfsstat *nfsproc_symlink_2();
  335. #define NFSPROC_MKDIR ((u_long)14)
  336. extern diropres *nfsproc_mkdir_2();
  337. #define NFSPROC_RMDIR ((u_long)15)
  338. extern nfsstat *nfsproc_rmdir_2();
  339. #define NFSPROC_READDIR ((u_long)16)
  340. extern readdirres *nfsproc_readdir_2();
  341. #define NFSPROC_STATFS ((u_long)17)
  342. extern statfsres *nfsproc_statfs_2();
  343.  
  344.